package com.hall.controller;

import com.hall.pojo.AppointmentClick;
import com.hall.pojo.AppointmentWatch;
import com.hall.pojo.common.Result;
import com.hall.service.MeetDetailsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.method.P;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("/meet")
public class MeetdetailsController {
    @Autowired
    MeetDetailsService meetDetailsService;
    @GetMapping("/getApp/{id}")
    public Result selectAppById(@PathVariable String id){
        return meetDetailsService.selectAppById(id);
    }
    @GetMapping("/getAppUser/{id}")
    public Result selectAppUserById(@PathVariable String id){
        return meetDetailsService.selectAppUserById(id);
    }
    @PostMapping("/addlike")
    public Result addLike(AppointmentClick ac, HttpSession session, HttpServletRequest request){
        return meetDetailsService.addLike(ac,session,request);
    }
    @PostMapping("/addwatch")
    public Result addWatch(AppointmentWatch aw, HttpSession session,HttpServletRequest reques){
        return meetDetailsService.addWatch(aw,session,reques);
    }
    @GetMapping("/getwatchNum/{id}")
    public Result selectNum(@PathVariable String id){
        return meetDetailsService.getWatchNum(id);
    }

}
